import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '用户ID',
    align: "center",
    dataIndex: 'userId'
  },
  {
    title: '登录账号',
    align: "center",
    dataIndex: 'userName'
  },
  {
    title: '店铺名称',
    align: "center",
    dataIndex: 'name'
  },
  {
    title: '店铺头像',
    align: "center",
    dataIndex: 'image',
    customRender: render.renderImage,
  },
  {
    title: '店铺地址',
    align: "center",
    dataIndex: 'address'
  },
  {
    title: '审核状态',
    align: "center",
    dataIndex: 'status',
    customRender: ({ text }) => {
      text = text == 0 ? '待审核' : text == 1 ? '已驳回' : '已通过';
      return text;
    },
  },


];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '用户ID',
    field: 'userId',
    component: 'Input',
  },
  {
    label: '店铺地址',
    field: 'address',
    component: 'Input',
  },
  {
    label: '审核状态 0未审核 1驳回 2通过',
    field: 'status',
    component: 'Input',
  },
  {
    label: '店铺名称',
    field: 'name',
    component: 'Input',
  },
  {
    label: '登录账号',
    field: 'userName',
    component: 'Input',
  },
  // TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false
  },
];

// 高级查询数据
export const superQuerySchema = {
  userId: { title: '用户ID', order: 0, view: 'text', type: 'string', },
  address: { title: '店铺地址', order: 1, view: 'text', type: 'string', },
  status: { title: '审核状态 0未审核 1驳回 2通过', order: 2, view: 'text', type: 'string', },
  name: { title: '店铺名称', order: 3, view: 'text', type: 'string', },
  userName: { title: '登录账号', order: 4, view: 'text', type: 'string', },
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[] {
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}